package com.twinkle.rpc.server;


import com.twinkle.rpc.common.service.AdminService;
import com.twinkle.rpc.common.service.UserService;
import com.twinkle.rpc.common.service.impl.AdminServiceImpl;
import com.twinkle.rpc.common.service.impl.UserServiceImpl;
import com.twinkle.rpc.server.cmmunication.RpcServer;
import com.twinkle.rpc.server.cmmunication.impl.NettyRPCServer;
import com.twinkle.rpc.server.provider.ServiceProvider;
import lombok.extern.slf4j.Slf4j;

/**
 * @author twinkle
 * @version 1.0
 * @create 2024/2/11 19:39
 */

public class TestServer {
    public static void main(String[] args) {
        UserService userService=new UserServiceImpl();
        AdminService adminService = new AdminServiceImpl();

        ServiceProvider serviceProvider=new ServiceProvider("127.0.0.1",9999);
        serviceProvider.provideServiceInterface(userService);
        serviceProvider.provideServiceInterface(adminService);
        RpcServer rpcServer = new NettyRPCServer(serviceProvider);
        rpcServer.start(9999);
    }
}
